import { send } from "https://deno.land/x/oak@v17.1.1/send.ts";
import { createApp } from "./router/index.ts";

const app = createApp()

app.use(async (context) => {
  const path = context.request.url.pathname;
  if (path.startsWith("/static/")) {
    await send(context, path.substring(7), {
      root: `${Deno.cwd()}/static`,
    });
  }
});

app.listen({ port: 8002 })
